<!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
<stack>
<name>in.1</name>
<id>-1</id>
<cardCount>1</cardCount>
<cardID>2870</cardID>
<listID>4041</listID>
<cantModify><false /></cantModify>
<cantDelete><true /></cantDelete>
<cantAbort><false /></cantAbort>
<cardSize>
<width>512</width>
<height>320</height>
</cardSize>
<script>on openstackglobal homescript,keynames,SelectedKey,padding,openfile,oldmessageglobal OldLevel,CurrentScript,StackOpen,FKeynameshide titlebarset cursor to busypush recent cardput the userlevel into OldLevelset the userlevel to 5put the loc of msg into oldmessageset the loc of msg to 20,17put "Opening Hyperkeys, please wait ..."put "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,"&¬"Open,Backslash,Close,Uparrow,Minus,Space,*,Quote,*,*,*,*,*,*,*,"&¬"Times,Plus,Comma,KpadMinus,Period,Slash,Zero,One,Two,Three,"&¬"Four,Five,Six,Seven,Eight,Nine,SemiColon,*,*,Equals,Apostrophe" into keynamesput "One,Two,Three,Four,Five,Six,Seven,Eight,Nine,Ten,Eleven,Twelve,Thirteen,Fourteen,Fifteen" into Fkeynamesput the script of stack "home" into homescripthide cd fld helpdodialog hideput "2.1" into cd fld versionput "" into cd fld 1put "" into cd fld 2put "" into openfileput "" into fld "title"put "" into fld "TheScript"put " " & return into paddingput "Unused Keys" into cd fld "filename"put "Home" into StackOpenGetStackInfomakeHyperkeysMenuset the hilite of btn "Control Driver" to installed(ControlKey)set the hilite of btn "FKeys Driver" to installed(FunctionKey)set the name of button 6 to "Open..."set the name of button 1 to "Can’t copy"set the name of button 2 to "Can’t copy"hide btn 1hide btn 2hide btn 3hide btn 4getInstalledKeysput "1,1," into selectedkeyhide msgunlock screen with iris openend openstackon closestackglobal oldmessage,oldlevelset loc of msg to oldmessagehide msgif there is a menu "Hyperkeys" then delete menu "Hyperkeys"if the freesize of this stack ≠ 0 then domenu "Compact Stack"set the userlevel to oldlevelshow titlebarvisual iris closeend closestackon suspendstackglobal oldmessage,oldlevelset loc of msg to oldmessagehide msgif there is a menu "Hyperkeys" then delete menu "Hyperkeys"pop card into junkset the userlevel to oldlevelend suspendstackon resumestackglobal oldmessage,oldlevelpush recent cardput the loc of msg into oldmessageset the loc of msg to 20,17hide msgmakeHyperkeysMenuput the userlevel into oldlevelset the userlevel to 5end resumestackfunction Installed Drivernameglobal homescriptif offset("on "&DriverName&" keynum",homescript) = 0 then return falseelse return trueend Installedon GetInstalledKeysset cursor to watchglobal currentscript,keynames,padding,FKeynames,openfileput 0 into theTotalrepeat with x = 1 to the number of items in keynamesif item x of keynames = "*" then next repeatif offset("On docontrol"& item x of keynames&return,currentscript) ≠ 0 thenput "Control — " & item x of keynames & padding after cd fld 1elseif openfile ="" thenadd 1 to TheTotalput "Control — " & item x of keynames & padding after cd fld 2end ifend ifset cursor to busyend repeatrepeat with x = 1 to the number of items in Fkeynamesif offset("On doFKey"& item x of Fkeynames&return,currentscript) ≠ 0 thenput "Fkey — " & item x of Fkeynames & padding after cd fld 1elseif openfile ="" thenadd 1 to theTotalput "Fkey — " & item x of Fkeynames & padding after cd fld 2end ifend ifset cursor to busyend repeatput " available" into Pluralif theTotal ≠ 1 then put "s" before Pluralif openfile = "" thenput TheTotal&&"Key"&Plural into line 2 of cd fld "Filename"end ifset the scroll of cd fld 2 to 0set the scroll of cd fld 1 to 0end GetInstalledKeyson GetScriptglobal Currentscript,SelectedKey,openfile,Stackopenput last word of SelectedKey into KeyNameput first word of item 3 of SelectedKey into KeyTypeput length(Keyname)+Length(Keytype) into TheLengthif keytype is empty thenput "" into fld "TheScript"put "" into fld "Title"hide btn 1hide btn 2hide btn 3hide btn 4exit GetScriptend ifput "Script of "&Keytype&"-"&keyname into fld titleif item 1 of SelectedKey is 1 thenput offset("On Do"&Keytype&keyname&return,Currentscript) into startput offset("End Do"&Keytype&keyname&return,Currentscript) into finishif start = finish then put "" into fld "TheScript"elseput char (start + thelength +7) to (finish - 2)¬of Currentscript into field "Thescript"end ifput return&"in"&&line 1 of cd fld "stackName" after fld titleelseif openfile = "" thenput "" into fld "Thescript"elseopen file openfileput "" into fld "Thescript"repeat foreverset cursor to busyread from file openfile until returnif it is "On Do"&Keytype&keyname&return thenrepeat foreverset cursor to busyread from file openfile until returnif it is "End Do"&keytype&keyname&return thenexit repeatelseput it after fld "TheScript"end ifend repeatexit repeatend ifend repeatclose file openfileput return&"in" && line 1 of cd fld filename after fld titleend ifend ifend GetScripton UpdateStackScriptglobal Currentscript,stackopenput "Writing to "& line 1 of cd fld "Stackname"set the script of stack stackopen to currentscripthide msgend UpdateStackScripton InstallDriver thenameglobal homescript,keynamesput the script of stack "home" into Homescriptif thename = "Fkey" then put "FunctionKey" into thenameset the cursor to watchput offset("on "&thename&" keynum",homescript) into startif start <> 0 thenbeepanswer "A "&thename&" driver is already installed"exit InstallDriverend ifdo "put field "&thename&"Driver into TheDriver"put "Installing Hyperkeys "&thename&" driver..."put the short date into word 4 of line 2 of TheDriverput the time into word 6 of line 2 of TheDriverif thename = "Controlkey" thenput quote&keynames"e into word 2 of line 3 of TheDriverend ifput TheDriver after homescriptset the script of stack "home" to homescripthide messageend installdriveron RemoveDriver thenameglobal homescriptput the script of stack "Home" into homescriptif thename = "Fkey" then put "functionkey" into thenameset the cursor to watchput offset("on "&thename&" keynum",homescript) into startput offset("end "&thename,homescript) into finishif start = 0 thenbeepanswer "Hyperkeys"&& thename&" driver is not installed"exit removeDriverend ifput "Removing Hyperkeys "& thename&" driver..."put "" into char start to finish + length(thename) +5 of homescriptif thename = "ControlKey" thenput offset("on docontrolH",homescript) into startput offset("end docontrolH",homescript) into finishif start ≠ finish thenput "" into char start to finish +15 of homescriptend ifend ifset the script of stack "home" to homescripthide messageend RemoveDriveron GetKeysFromFileglobal openfile,keynames,padding,FKeynamesopen file openfileread from file openfile for 16384repeat with x = 1 to the number of lines in itset cursor to busyput the number of chars in line x of it into TheLastif char 1 to 12 of line x of it is "On DoControl" thenput "Control — "& char 13 to Thelast of line x of it & padding after cd fld 2end ifif char 1 to 9 of line x of it is "On DoFkey" thenput "Fkey — "& char 10 to Thelast of line x of it & padding after cd fld 2end ifend repeatclose file openfileend GetKeysFromFileon GetstackInfoglobal StackOpen,CurrentScriptput the script of stack StackOpen into CurrentScriptput round((the size of stack StackOpen)/1024) into TheSizeput round((the FreeSize of stack StackOpen)/1024) into TheFreeput stackopen into thestackput "Stack"&"e"e into cd fld "stackname"repeat while last char of thestack ≠ ":" and thestack ≠ emptyput last char of thestack after char 7 of cd fld "stackname"put "" into last char of thestackend repeatput return&TheSize&"K ("&TheFree&"K free)" after cd fld "StackName"end GetstackInfoon getfileinfoglobal openfileput openfile into thefileput "File"&"e"e into cd fld "filename"repeat while last char of thefile ≠ ":" and thefile ≠ emptyput last char of thefile after char 6 of cd fld "filename"put "" into last char of thefileend repeatopen file openfileread from file openfile for 16384close file openfileput return &the number of chars in it&" Characters" after cd fld "filename"end getfileinfoon doCopyglobal SelectedKey,CurrentScript,openfile,stackopenput last word of selectedkey into keynameput first word of item 3 of selectedkey into KeyTypeput length(Keyname)+Length(Keytype) into TheLengthif item 1 of selectedkey is "2" thenput Currentscript into Tempelseput "" into Tempopen file openfileread from file openfile for 16384put it into tempclose file openfileend ifif last item of selectedkey is in cd fld (3-item 1 of selectedkey) thenanswer Keytype&&"-"&&keyname&" already exists ..." with "Replace" or "Cancel"if it is "Cancel" thenexit docopyend ifelseput return &"On Do"&Keytype&keyname&return&return&¬"End Do"&Keytype&keyname&return after Tempend ifput offset("On Do"&keytype&keyname&return,Temp) into startput offset("End Do"&keytype&keyname&return,Temp) into finishput fld "TheScript"&return into TheTextif TheText is empty then put return into TheTextput TheText into char start+6+TheLength to finish -1 of Tempif item 1 of selectedkey = "2" thenput Temp into CurrentscriptUpdateStackScriptgetstackinfoelseopen file openfilerepeat with x = 1 to the number of lines in Tempset cursor to busywrite line x of Temp & return to file openfileend repeatclose file openfileend ifend docopyon DoDialog DoWhatput "btn Cover,cd fld dlog,cd fld dlog2,btn OK,btn Cancel," into Itemlistput "cd fld dlog3,cd fld Action,cd fld Choose" after ItemListset lockscreen to truerepeat with x =1 to the number of items in itemlistif DoWhat is "Show" then do "Show "&item x of itemlistelse do "Hide "&item x of itemlistend repeatset lockscreen to falseend DoDialogOn DoControlHclick at the loc of btn "about"End DoControlHon makeHyperkeysMenuif there is a menu "Hyperkeys" then exit makeHyperkeysMenucreate menu "Hyperkeys"put makeHyperkeysMenuItems() into menu "Hyperkeys" with menuMsg makeHyperkeysMenuMsgs()disable menuItem 2 of menu "Hyperkeys"disable menuItem 4 of menu "Hyperkeys"disable menuItem 5 of menu "Hyperkeys"disable menuItem 7 of menu "Hyperkeys"if installed(ControlKey) thenenable menuItem 4 of menu "Hyperkeys"disable menuItem 3 of menu "Hyperkeys"end ifif installed(FunctionKey) thenenable menuItem 7 of menu "Hyperkeys"disable menuItem 6 of menu "Hyperkeys"end ifend makeHyperkeysMenufunction makeHyperkeysMenuItemsreturn "About Hyperkeys ..." & return & ¬"-" & return & ¬"Install Control Key driver" & return & ¬"Remove Control Key driver" & return & ¬"-" & return & ¬"Install Fkey driver" & return & ¬"Remove Fkey driver" & returnend makeHyperkeysMenuItemsfunction makeHyperkeysMenuMsgsreturn "Click at the loc of btn " & quote & "About" & quote & return & ¬"" & return & ¬"Click at loc of btn id 38" & return & ¬"Click at loc of btn id 38" & return & ¬"" & return & ¬"Click at loc of btn id 37" & return & ¬"Click at loc of btn id 37"end makeHyperkeysMenuMsgs</script>